package org.paradise.dms.util;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

import org.apache.commons.httpclient.util.ExceptionUtil;
import org.apache.log4j.Logger;
import org.paradise.dms.pojo.BaseException;
import org.paradise.dms.pojo.DeliverStation;
import org.paradise.dms.pojo.MessageOut;




/**
 * Description:涉及印章的操作：将rs转为DailySeal，新增及修改代码。
 */
public class MessageOutUtil {
	
	private static Logger log = Logger.getLogger(MessageOutUtil.class);
	/**
	 * Description:将rs中的字段转为DailySeal相应的字段
	 * @param rs
	 * @return
	 */
	
	
	/**
	 * Description:新增时sql代码
	 * @param conn
	 * @param dailySeal
	 * @return
	 */
	public static PreparedStatement getInsertPreparedStatement(Connection conn,
			MessageOut messageOut,String tableName) throws BaseException{
		PreparedStatement pstmt = null;
		String sql = "insert into messageout (id,receivertelephone,messagecontent,messagetime,messagesend) values (?,?,?,?,?)";
		try {
			pstmt = conn.prepareStatement(sql);
			
			
			pstmt.setLong(1, messageOut.getId());
			pstmt.setString(2, messageOut.getReceivertelephone());
			pstmt.setString(3, messageOut.getMessagecontent());
			pstmt.setTimestamp(4,  messageOut.getMessagetime());
			pstmt.setString(5, messageOut.getMessagesend());
			
		}catch(Exception e) {
		

			log.error("getInsertPreparedStatement(Connection conn,DailySeal dailySeal)方法出错：" + e.getMessage()+",sql="+sql);
			
		}
		return pstmt;
	}
	
	


}
